<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>商品列表</title>

    <link rel="stylesheet" th:href="@{/css/admin.css}">
</head>
<body>

<table class="tab_list">
    <tr class="tab_title">
        <th>商品编号</th>
        <th>图片</th>
        <th>商品名称</th>
        <th>价格</th>
        <th>产地</th>
        <th>生产日期</th>
        <th>分类</th>
        <th>操作</th>
    </tr>
    <th:block th:each="goods:${goodsList}">
        <tr style="text-align: center">
           <td th:text="${goods.goodsId}"></td>
           <td>
               <img th:src="${goods.picture}" width="50" height="60" alt="">
           </td>  
           <td th:text="${goods.goodsName}"></td>
           <td th:text="${goods.price}"></td>
           <td th:text="${goods.address}"></td>
           <td th:text="${#dates.format(goods.produceDate,'yyyy-MM-dd')}"></td>
           <td th:text="${goods.category.categoryName}"></td>
           <td>
               <a th:href="@{/admin/goods/update(goodsId=${goods.goodsId})}">修改</a>
               <a href="/admin/goods/add">添加</a>
           </td>
        </tr>
    </th:block>
</table>

</body>
</html>